<template>
    <div class="resultsList">
        <div>
            <span class="titlefont">筛选：</span>
            <span class="label" ref="tag" @click="label(i)" v-for="(con,i) of sortList" :key="i">{{con}}</span>
        </div>
        <!-- 三种不同的样式搜索结果 -->
       <div class="listBox">
            <div class="left">
                <!-- <div class="listAritcle" >
                    <h3>文章部分</h3>
                    <div class="content">
                        <listAritcle  v-for="i of 25" :key="i"/>
                    </div>
                    
                </div> -->
                <!-- 视频列表展示内容部分 -->
                <!-- <div class="listVideo" >
                    <h3>视频部分</h3>
                    <div class="content">
                        <listVideo  v-for="i of 5" :key="i"/>
                    </div>
                </div> -->

                <!-- <div class="listImage">
                    <h3>图片部分</h3>
                    <div class="content">
                        <listImage  v-for="i of 5" :key="i"/>
                    </div>
                </div> -->
                <modelPage :selectDate="['文章列表','article List']"/>
                <modelPage :selectDate="['视频列表','video List']"/>
                
            </div>
            <div class="right">
                <div class="history">
                    <h3 class="rightTitle">
                        <span>搜索历史</span>
                        <span>查看更多</span>
                    </h3>
                    <ul class="historyDiv">
                        <li>测试</li>
                        <li>测试</li>
                        <li>测试</li>
                        <li>测试</li>
                    </ul>
                </div>
                <div>
                    <h3>热门搜索</h3>
                    <ul class="rightUl">
                        <li date-num="1"><a href="#">吃鸡不吐鸡骨头</a></li>
                        <li date-num="2"><a href="#">你别说话，我想</a></li>
                        <li date-num="3"><a href="#">没有谁想这样</a></li>
                        <li date-num="4"><a href="#">没有谁想这样</a></li>
                        <li date-num="5"><a href="#">吃鸡不吐鸡骨头</a></li>
                        <li date-num="6"><a href="#">你别说话，我想</a></li>
                        <li date-num="7"><a href="#">没有谁想这样</a></li>
                        <li date-num="8"><a href="#">没有谁想这样</a></li>
                    </ul>
                </div>
            </div>
       </div>
    </div>
</template>

<style scoped>
.listBox {
    padding: 1rem;
    display: flex;
    width: 1492px;
    margin: auto;
}
.left {
    flex-grow: 1;
    border-radius: 8px;
    padding: 1rem;
}
.content {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
}
.right>div {
    margin-top: 1rem;
    min-width: 280px;
    background-color: rgb(241, 236, 236);
    /* background-color: #f4f5f6; */
    opacity: .8;
    border-radius: 8px;
    padding: 1rem;
}
.rightTitle {
    display: flex;
    justify-content: space-between;
}
.rightTitle>span:first-child {
    font-size: 16px;
    color: #2c3033;
}
.rightTitle>span:last-child {
    padding: 3px 6px;
    border-radius: 2px;
    background: #eaf4fc;
    margin-left: auto;
    font-size: 12px;
    color: #3399ea;
    letter-spacing: 0;
    line-height: 16px;
}
.rightTitle>span:last-child:hover {
    color: #85c5ee;
}
.rightUl {
    list-style: none;
    color: #787977;
}
.rightUl>li {
    height: 40px;
    line-height: 40px;
    margin: 0 30px;
    padding: 0 30px;
    transition: all .4s;
    border-bottom: 1px solid #f8f9f7;
    position: relative;
}
.rightUl>li::before {
    content: attr(date-num);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(0,-50%);
    line-height: 40px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background-color: #1b1b1b;
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
    border-radius: 50%;
    color: white;
}
.rightUl>li:hover {
    background-color: #f8f9f7;
    border-right: 6px solid black;
}
.rightUl>li>a:hover {
    text-decoration: underline;
    color: #6bc30d;
}
.rightUl>li:first-child:before {
    background-color: #e24d46;
}
.rightUl>li:nth-child(2):before {
    background-color: #2ea7e0;
}
.rightUl>li:nth-child(3):before {
    background-color: #6bc30d;
}
.historyDiv {
    padding: 1rem 0;
}
.historyDiv>li {
    padding: 4px 12px 4px 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    font-size: 12px;
    line-height: 30px;
    margin-bottom: 12px;
    display: block;
    transition: all .2s ease;
    list-style: none;
    background-color: white;
}
.historyDiv>li::before {
    position: absolute;
    content: "";
    width: 3px;
    height: 3px;
    background: #000;
    border-radius: 10px;
    left: 15px;
    top: 20px;
}
.historyDiv>li:hover {
    background: #f2f2f2;
    box-shadow: 0 0 10px #ccc;
}
</style>

<script>
import listAritcle from "@/components/yc/listAritcle"
import listVideo from "@/components/yc/listVideo"
import listImage from "@/components/yc/listImage"
// 导入modelPage
import modelPage from "@/components/yc/modelPageAll"
export default {
    data(){
        return {
            //   排序情况数组
            sortList:['升序','降序','智能排序','全部','推荐','图文']
        }
    },
    methods: {
        label(index){
            this.$refs.tag.forEach((item)=>{
                item.className="label"
            })
            this.$refs.tag[index].className="label defaultActive"
        }
    },
    components: {
        listAritcle,
        listVideo,
        listImage,
        modelPage
    }
}
</script>